package com.itdct.onflow.generator.template

import com.itdct.onflow.generator.config.GeneratorConfig
import com.itdct.onflow.generator.model.ClassModel

/**
 * @author Zhouwx
 * @date 2025/8/11 16:45:17
 * @version 1.0
 * @description
 */
class DetailVoTemplate(classModel: ClassModel, generatorConfig: GeneratorConfig) : ListVoTemplate(classModel, generatorConfig) {
    init {
        filterFieldList.add("id")
        filterFieldList.add("del")
        filterFieldList.add("version")
        filterFieldList.add("deleteUser")
        filterFieldList.add("deleteTime")
    }
    override fun render(): String {
        return """
${uuidPrint()}
package ${classModel.packageName}.vo

import com.itdct.onflow.core.vo.BaseDetailVo
import io.swagger.v3.oas.annotations.media.Schema
import java.util.*${extraImports()}

/**
 * @author ${generatorConfig.authorName}
 * @date ${getDateString()}
 * @version 1.0
 * @description ${classModel.classUsage}详情返回值
 */
@Schema(name = "${classModel.classUsage}详情返回值", description = "${classModel.classUsage}详情返回值")
class ${classModel.className}DetailVo : BaseDetailVo() {
${rangeStart("fields")}
${setFields()}
${rangeEnd("fields")}${createUpdateUserField()}
}
""".trimIndent()
    }

    override fun getFolderFileName(): String {
        return "vo/${classModel.className}DetailVo.kt"
    }

}